<?php
/*
To list all the products under any category
Author: NajeebMedia.com
*/
?>
<?php

$args = array(	'category__in'	=> array($cat),
				'paged' => $paged,
				'meta_key' => 'product_order_number',
				'orderby' => (int)'meta_value',
				'order' => 'ASC'
			);
				
//query_posts(array('category__not_in' => $my_child_IDs));
query_posts($args);

?>

<section class="general-wrapper category">
<br />
<?php renderAdForm('left-1');?>

<?php if ( have_posts() ) : ?>
<ul>
<?php  while ( have_posts() ) : the_post();

//fech $link_sub_category;
$is_category_post = get_post_meta($post->ID, 'is_category_post', true);
if($is_category_post)
	$url = get_category_link($is_category_post);
else
	$url = get_permalink();
	
?>
	<li>
    	 <a href="<?php echo $url?>" class="post-thumb"><?php if ( has_post_thumbnail() ) the_post_thumbnail('general'); ?></a>
        <div class="title"><h2><a href="<?php echo $url?>" rel="bookmark"><?php the_title(); ?></a></h2></div>
    </li>
	<?php

       endwhile; // end of the loop.
    ?>
</ul>
<?php else:?>

<div class="loop">
        <div id="post-0" class="post hentry error404 not-found clear">
            <h2><?php _e( 'Not found', 'unspoken' ); ?></h2>
            <p><?php _e( 'Apologies, but no results were found for the requested criteria. Perhaps searching will help find a related post.', 'unspoken' ); ?></p>
        </div><!-- #post-0 -->
    </div>
    
<?php endif;?>

<?php renderAdForm('left-2');?>

</section>
